import { Suspense, lazy } from 'react'
import { Outlet, type RouteObject } from 'react-router-dom'
import { Spin } from 'antd'

const Dashboard = lazy(() => import('@/views/dashboard'))

// const routes: RouteObject[] = [
//   {
//     path: '/info/dashboard',
//     element: (
//       <Suspense fallback={<Spin size='large' />}>
//         <Dashboard />
//       </Suspense>
//     )
//   }
// ]
const routes: RouteObject[] = [
  {
    path: 'info',
    element: <Outlet />,
    children: [
      {
        path: 'dashboard',
        element: (
          <Suspense fallback={<Spin size='large' />}>
            <Dashboard />
          </Suspense>
        )
      }
    ]
  }
]

export default routes
